package org.sippr.rvt2ifc.service.impl;

import org.sippr.rvt2ifc.dao.XktModelDao;
import org.sippr.rvt2ifc.pojo.ProjectMark;
import org.sippr.rvt2ifc.pojo.XktModel;
import org.sippr.rvt2ifc.service.XktModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XktModelImpl implements XktModelService {
    @Autowired
    private XktModelDao xktModelDao;

    @Override
    public void insert(XktModel xktModel) {

    }

    @Override
    public List<XktModel> listByState(Integer state) {

        return xktModelDao.selectByState(state);
    }

    @Override
    public void updateState(String fileUuid, Short state) {
        XktModel xktModel = xktModelDao.selectByFileUuid(fileUuid);
        if (xktModel == null) {
            return;
        }
        xktModel.setState(state);
        xktModelDao.updateByPrimaryKeySelective(xktModel);

    }
}
